{template 'common/header3'}
{if empty($item)}
{php $namesuffix = '-new[(wrapitemid)]';}
{php $namesuffixid = '-new(wrapitemid)';}
{php $itemid = '(itemid)';}
{else}
{php $namesuffix = '['.$item['id'].']';}
{php $namesuffixid = $item['id'];}
{php $itemid = 'ccc-item-' . $item['id'];}
{/if}

<div class="alert alert-info reply-market-list" id="prize_list_div">
	<table class="tb reply-news-edit">
		<tr>
			<th>奖品类型：</th>
			<td id="award-inkind">
				<span class="pull-right">{if empty($item)}<a href="javascript:;" onclick="doDeleteItem('{$itemid}')">删除</a>{else}<a href="{php echo $this->createWebUrl('delete', array('id' => $item['id']))}" onclick="doDeleteItem('{$itemid}', this.href)">删除</a>{/if}</span>
				<label for="radio_1_{$itemid}" class="radio inline" data-placement="bottom" data-toggle="popover" data-content="领奖需后台确认，适用于O2O" data-original-title="" style="width:50px;"><input type="radio" name="award-inkind{$namesuffix}" id="radio_1_{$itemid}" value="1" {if $item['inkind'] == 1} checked="checked"{/if}{if !empty($item)} disabled=true{/if} /> 实物</label><label for="radio_0_{$itemid}" class="radio inline" data-placement="bottom" data-toggle="popover" data-content="粉丝自主领奖无需后台确认，适用于普通卡密发放" data-original-title="" style="margin-left:0; width:70px;"><input type="radio" name="award-inkind{$namesuffix}" id="radio_0_{$itemid}" value="0" {if $item['inkind'] == 0} checked="checked"{/if}{if !empty($item)} disabled=true{/if} /> 卡密</label>
			</td>
		</tr>
		<tr>
			<th>礼盒名称：</th>
			<td>
				<input type="text" value="{$item['lihetitle']}" style="width:275px;" name="award-lihetitle{$namesuffix}" placeholder="填写礼盒名称">
			</td>
		</tr>
		<tr>
			<th>礼盒图片：</th>
			<td>
                <select  class="input-medium" class="select-img" id="award-gift{$namesuffix}" data-rule-required="true" name="award-gift{$namesuffix}">
                        <option value="1" {if $item['gift']==1} selected="selecteed"{/if}>礼盒1</option>
                        <option value="2" {if $item['gift']==2} selected="selecteed"{/if}>礼盒2</option>
                        <option value="3" {if $item['gift']==3} selected="selecteed"{/if}>礼盒3</option>
                        <option value="4" {if $item['gift']==4} selected="selecteed"{/if}>礼盒4</option>
                        <option value="5" {if $item['gift']==5} selected="selecteed"{/if}>礼盒5</option>
	         </select>
			</td>
		</tr>
		<tr>
			<th>礼盒声音：</th>
			<td>
					<select class="input-medium select-voice" data-rule-required="true" id="award-giftVoice{$namesuffix}" name="award-giftVoice{$namesuffix}">
							<option data-link="0" value="0" ><i class="play-btn"></i>无响声</option>
							<option value="1"{if $item['giftVoice']==1} selected="selecteed"{/if}><i class="play-btn"></i>响声1</option>
							<option value="2"{if $item['giftVoice']==2} selected="selecteed"{/if}><i class="play-btn"></i>响声2</option>
							<option value="3"{if $item['giftVoice']==3} selected="selecteed"{/if}><i class="play-btn"></i>响声3</option>
							<option value="4"{if $item['giftVoice']==4} selected="selecteed"{/if}><i class="play-btn"></i>响声4</option>
							<option value="5"{if $item['giftVoice']==5} selected="selecteed"{/if}><i class="play-btn"></i>响声5</option>
					</select>
			</td>
		</tr>
		<tr>
			<th>帮拆人数：</th>
			<td><div class="input-prepend input-append">
                    <span class="add-on">需要邀请</span>
                    <input type="text" class="span1" name="award-break{$namesuffix}" id="award-break{$namesuffix}" value="{$item['break']}" />
                    <span class="add-on">位朋友帮其拆开礼盒</span>
                </div><span class="help-block1">*0为自动拆开,大于0需要邀请朋友帮其拆开</span>			
			</td>
		</tr>
		<tr>
			<th>奖品名称：</th>
			<td>
				<input type="text" value="{$item['title']}" style="width:275px;" name="award-title{$namesuffix}" placeholder="填写奖品名称">
				<label style="display:inline-block;">中奖率：<input type="text" value="{$item['probalilty']}" name="award-probalilty{$namesuffix}" style="padding-right:30px;width:48px;"><em class="percentage">%</em></label>
				<label {if $item['inkind'] == 0}style="display:none;"{else}style="display:inline-block;"{/if} class="num">数量：<input type="text" value="{$item['total']}" style="width:45px;" name="award-total{$namesuffix}"></label><div class="help-block">中奖率最小为10万分之一，即中奖率为0.001 至100之间的数值 超出中奖不准</div>
			</td>
		</tr>
		<tr>
			<th>奖品描述：</th>
			<td>
				<textarea style="height:80px;" name="award-description{$namesuffix}" class="span7" cols="70" id="" placeholder="填写奖品描述，颜色、类型、规格等">{$item['description']}</textarea>
			</td>
		</tr>
		{if $item['inkind'] == 0}
		<tr>
			<th>兑 换 码：</th>
			<td>
				<textarea style="height:80px;" class="span7" cols="70" id="" name="award-activation-code{$namesuffix}" placeholder="填写兑换码或者其他密文类SN码，一行一个">{$item['activation_code']}</textarea>
			</td>
		</tr>
		<tr>
			<th>兑换方式：</th>
			<td>
				<input type="text" id="" class="span7" value="{$item['activation_url']}" name="award-activation-url{$namesuffix}" placeholder="填写激活地址或者其他领奖方法">
			</td>
		</tr>
		{/if}
		<tr>
			<th>兑换密码：</th>
			<td>
				<input type="text" id="" class="span7" value="{$item['awardpass']}" name="award-pass{$namesuffix}" placeholder="手机端兑奖密码">
			</td>
		</tr>
		{if !empty($item)}
		<tr>
			<th>奖品图片：</th>
			<td><div style="display:block; margin-top:5px;" class="input-append">
						<input type="text" value="{$item['awardpic']}" name="awardpic{$namesuffix}" id="upload-image-url-awardpic{$namesuffixid}" class="span3" autocomplete="off">
						<input type="hidden" value="{$item['awardpic']}" name="awardpic{$namesuffixid}_old" id="upload-image-url-awardpic{$namesuffixid}-old">
						<button class="btn" type="button" id="upload-image-awardpic{$namesuffixid}">选择图片</button>
						</div>
						<div id="upload-image-preview-awardpic{$namesuffixid}" style="margin-top:10px;"><img src="{$_W['attachurl']}{$item['awardpic']}" width="180" /></div><div class="help-block">奖品图片建议尺寸：900像素 * 500像素</div>
			
			</td>
		</tr>
		{else}
		<tr>
			<th>奖品图片：</th>
			<td>
			<div class="fileupload fileupload-new item-image" tabindex="-1" data-provides="fileupload" style='margin-top:5px;width:425px;'>
       		<div id="thumb0_span" tabindex="-1" class="fileupload-preview thumbnail" style="float:left;;width: 180px; height: 180px;">
           	    <img src="../addons/stonefish_chailihe/template/images/award.jpg" width="180" /></div>
      		    <div style='float:left;margin-left:5px;'>
           		    <span class="btn btn-file">
                  	<span class="fileupload-new">选择图片</span><span class="fileupload-exists">更改</span><input name="awardpic{$namesuffixid}" type="file"  class='vote_img_file'/></span>
            	    <br/><a href="#" class="btn fileupload-exists" data-dismiss="fileupload" style='margin-top:5px'>移除</a>
        		</div>   		     
			</div>			
			</td>
		</tr>
		{/if}
	</table>
</div>
